using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace AjGenesisStudio
{
    class Global
    {
        private static Global instance;

        public static Global Instance
        {
            get {
                if (instance == null)
                    instance = new Global();
                return instance; 
            }
            set { instance = value; }
        }


        private MainForm mainfrm;

        public MainForm MainForm
        {
            get { return mainfrm; }
            set { mainfrm = value; }
        }

        public void Log(string text)
        {
            MainForm.ShowOutputLog();
            Panels.OutputPanel.Instance.Log(text);
        }

        public void LogLine(string text)
        {
            MainForm.ShowOutputLog();
            Panels.OutputPanel.Instance.LogLine(text);
        }

        public void ClearLog()
        {
            Panels.OutputPanel.Instance.ClearOutput();
        }

        public void StartWork(string status)
        {
            Application.UseWaitCursor = true;
            MainForm.Cursor = Cursors.WaitCursor;
            SetStatus(status + "...");
        }

        public void StartWork()
        {
            StartWork("Working");
        }

        public void EndWork()
        {
            Application.UseWaitCursor = false;
            MainForm.Cursor = Cursors.Default;
            SetStatus("Ready");
        }

        public void SetStatus(string text)
        {
            MainForm.SetStatus(text);
        }

    }
}
